import { socket } from "@kit.NetworkKit";
export class NetAddress implements socket.NetAddress{
  address: string = "";
  family?: number = 1;
  port?: number;
  constructor(address?: string, family?: number, port?: number) {
    this.address = address;
    this.family = family;
    this.port = port;
  }
}

export class ProxyOptions implements socket.ProxyOptions{
  type: number;
  address: NetAddress = new NetAddress();
  username?: string;
  password?: string;
  constructor(type?: socket.ProxyTypes, address: NetAddress = new NetAddress(), username?: string, password?: string) {
    this.type = type;
    this.address = address;
    this.username = username;
    this.password = password;
  }
}

export class TCPConnectOptions implements socket.TCPConnectOptions{

  address: NetAddress = new NetAddress();
  timeout?: number;
  proxy?: ProxyOptions = new ProxyOptions();
  constructor(address: NetAddress = new NetAddress(), timeout?: number, proxy: ProxyOptions = new ProxyOptions()) {
    this.address = address;
    this.timeout = timeout;
    this.proxy = proxy;
  }
}